/*   1:    */ package org.jetbrains.jps.model.library.impl.sdk;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.util.Comparing;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.JpsElement;
import org.jetbrains.jps.model.JpsElementFactory;
import org.jetbrains.jps.model.ex.JpsCompositeElementBase;
import org.jetbrains.jps.model.library.impl.JpsLibraryImpl;
import org.jetbrains.jps.model.library.sdk.JpsSdk;
import org.jetbrains.jps.model.library.sdk.JpsSdkReference;
import org.jetbrains.jps.model.library.sdk.JpsSdkType;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */ 
/*  14:    */ public class JpsSdkImpl<P extends JpsElement>
/*  15:    */   extends JpsCompositeElementBase<JpsSdkImpl<P>>
/*  16:    */   implements JpsSdk<P>
/*  17:    */ {
/*  18:    */   private final JpsSdkType<P> a;
/*  19:    */   private String b;
/*  20:    */   private String c;
/*  21:    */   
/*  22:    */   public JpsSdkImpl(String paramString1, String paramString2, JpsSdkType<P> paramJpsSdkType, P paramP)
/*  23:    */   {
/*  24: 37 */     this.b = paramString1;
/*  25: 38 */     this.c = paramString2;
/*  26: 39 */     this.a = paramJpsSdkType;
/*  27: 40 */     this.myContainer.setChild(paramJpsSdkType.getSdkPropertiesRole(), paramP);
/*  28:    */   }
/*  29:    */   
/*  30:    */   private JpsSdkImpl(JpsSdkImpl<P> paramJpsSdkImpl)
/*  31:    */   {
/*  32: 44 */     super(paramJpsSdkImpl);
/*  33: 45 */     this.a = paramJpsSdkImpl.a;
/*  34: 46 */     this.b = paramJpsSdkImpl.b;
/*  35: 47 */     this.c = paramJpsSdkImpl.c;
/*  36:    */   }
/*  37:    */   
/*  38:    */   @NotNull
/*  39:    */   public JpsSdkImpl<P> createCopy()
/*  40:    */   {
/*  41: 53 */     void tmp8_5 = new JpsSdkImpl(this);
/*  42: 53 */     if (tmp8_5 == null) {
/*  43: 53 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/library/impl/sdk/JpsSdkImpl", "createCopy" }));
/*  44:    */     }
/*  45: 53 */     return tmp8_5;
/*  46:    */   }
/*  47:    */   
/*  48:    */   public P getSdkProperties()
/*  49:    */   {
/*  50: 58 */     return this.myContainer.getChild(this.a.getSdkPropertiesRole());
/*  51:    */   }
/*  52:    */   
/*  53:    */   public JpsSdkReference<P> createReference()
/*  54:    */   {
/*  55: 63 */     return JpsElementFactory.getInstance().createSdkReference(getParent().getName(), this.a);
/*  56:    */   }
/*  57:    */   
/*  58:    */   public JpsSdkType<P> getSdkType()
/*  59:    */   {
/*  60: 68 */     return this.a;
/*  61:    */   }
/*  62:    */   
/*  63:    */   @NotNull
/*  64:    */   public JpsLibraryImpl<JpsSdk<P>> getParent()
/*  65:    */   {
/*  66: 75 */     JpsLibraryImpl tmp7_4 = ((JpsLibraryImpl)super.getParent());
/*  67: 75 */     if (tmp7_4 == null) {
/*  68: 75 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/library/impl/sdk/JpsSdkImpl", "getParent" }));
/*  69:    */     }
/*  70: 75 */     return tmp7_4;
/*  71:    */   }
/*  72:    */   
/*  73:    */   public void applyChanges(@NotNull JpsSdkImpl<P> paramJpsSdkImpl)
/*  74:    */   {
/*  75: 80 */     if (paramJpsSdkImpl == null) {
/*  76: 80 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/library/impl/sdk/JpsSdkImpl", "applyChanges" }));
/*  77:    */     }
/*  78: 80 */     super.applyChanges(paramJpsSdkImpl);
/*  79: 81 */     setHomePath(paramJpsSdkImpl.getHomePath());
/*  80: 82 */     setVersionString(paramJpsSdkImpl.getVersionString());
/*  81:    */   }
/*  82:    */   
/*  83:    */   public String getHomePath()
/*  84:    */   {
/*  85: 87 */     return this.b;
/*  86:    */   }
/*  87:    */   
/*  88:    */   public void setHomePath(String paramString)
/*  89:    */   {
/*  90: 92 */     if (!Comparing.equal(this.b, paramString))
/*  91:    */     {
/*  92: 93 */       this.b = paramString;
/*  93: 94 */       fireElementChanged();
/*  94:    */     }
/*  95:    */   }
/*  96:    */   
/*  97:    */   public String getVersionString()
/*  98:    */   {
/*  99:100 */     return this.c;
/* 100:    */   }
/* 101:    */   
/* 102:    */   public void setVersionString(String paramString)
/* 103:    */   {
/* 104:105 */     if (!Comparing.equal(this.c, paramString))
/* 105:    */     {
/* 106:106 */       this.c = paramString;
/* 107:107 */       fireElementChanged();
/* 108:    */     }
/* 109:    */   }
/* 110:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.library.impl.sdk.JpsSdkImpl

 * JD-Core Version:    0.7.0.1

 */